#!/usr/bin/perl

######################################################################
package Swignition::TurtleParser;
######################################################################

use utf8;
use strict;

use Swignition::GenericParser;
use vars qw(@ISA);
@ISA = qw(Swignition::GenericParser);

sub new
{
	my $class    = shift;
	my $source   = shift;
	my $opts     = shift;
	my $this     = Swignition::GenericParser::object_structure($source, $opts);
	
	bless $this, $class;	
	
	$this->find_base_uri;

	if ($this->{options}->{p_AUTO})
	{
		$this->{RDF}->{ $this->uri } = Swignition::RDFModel::Subject->new($this->uri);	

		Swignition::GenericParser::RDF::handle($this, $source, $this->uri, 'turtle');

		Swignition::GenericParser::HTTP::consume($this)
			if Swignition::GenericParser::HTTP::is_enabled($this);

		Swignition::GenericParser::Recursive::consume($this)
			if Swignition::GenericParser::Recursive::is_enabled($this);
		
		$this->smush;
	}

	return $this;	
}

1;
